<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>米行域名批量交易平台-交易所 用户注册</title>
<include file="./Public/public/public.html" />
<link rel="stylesheet" type="text/css" href="{$app_path}{$static_path}/css/register.css">
</head>
<body>
	<include file="./Public/public/top.html" />
	<div class="layout-wrap register">
		<div class="tab-group mobile-only">
			<a class="active">密码登录</a> <a>短信登录</a>
			<div class="clr"></div>
		</div>
		<div class="layout" style="background-color: #fff">

			<div class="swiper-container"  style="width: 2342px; height: 465px;">
				<div class="swiper-wrapper" style="width: 2340px; height: 463px;">
					<div class="swiper-slide swiper-slide-visible swiper-slide-active">
						<div class="box">

							<h3>
								<i class="fa fa-mobile-phone fa-lg"></i> 密码登录
							</h3>
							<div>
								<form action="{:U('Login/userLoginByPaswd')}" method="post" class="leftlogin" id="loginFormId">
									<div class="form-row form-row-s">
										<input class="input-s mobile mt20" placeholder="手机/邮箱/会员ID"
											name="uid" valid="{required:true}"
											msg="{required:'请输入手机号/邮箱/会员ID'}">
									</div>
									<div class="form-row form-row-s mt10">
										<input name="paswd" type="password" class="input-s pwd"
											placeholder="密码" onpaste="return false"
											oncopy="return false;" oncut="return false;"
											valid="{required:true}"
											msg="{required:'请填写密码'}">
									</div>
									<div class="form-row form-row-s mt5">
										<span class="red06 f12"></span>
									</div>
									<div class="form-row-s mt10">
										<a action="login" class="button-s button-orange w100">登录</a>
										<div class="clr"></div>
									</div>
									<div class="form-row form-row-s mt10">
										<a class="fl" href="{:U('Login/forget')}">忘记密码?</a> <a
											class="fr" href="{:U('Register/index')}"><b>立刻注册</b></a>
									</div>
								</form>
							</div>
						</div>
					</div>
					<div class="swiper-slide">
						<div class="box left">
							<h3>
								<i class="fa fa-mobile-phone fa-lg"></i> 短信登录
							</h3>
							<div>
								<form action="{:U('Login/userLoginByMobile')}" method="post"
									class="rightlogin">
									<div class="form-row form-row-s">
										<input class="input-s mobile mt20" placeholder="手机" name="mobile" maxlength="11"
											valid="{required:true,cellphone:true}"
											msg="{required:'请输入手机号',cellphone:'输入的手机不正确'}">
									</div>
									<div class="form-row form-row-s mt10">
										<div class="input-name w50">
											<input id="smscode4799" name="code" type="tel"
												valid="{required:true,number:true,limitLength:6}"
												msg="{required:'请填写6位数字短信验证码',number:'请填写6位数字短信验证码',limitLength:'请填写6位数字短信验证码'}"
												class="input-s" placeholder="短信验证码">
										</div>

										<div class="input-name-even w50">
											<div id="11_timer1033" watch="phone" name="code"
												method="sms" emsg="请输入正确的手机号"
												token="6560d551b8fbc66970d5a5c2f977f0e5" left="0"
												class="timer w100">发送验证码</div>
										</div>
										<div class="clr"></div>
									</div>
									<div class="form-row form-row-s mt5">
										<span class="red06 f12"></span>
									</div>
									<div class="form-row-s mt10">
										<a action="login" class="button-s button-blue w100">登录</a>
										<div class="clr"></div>
									</div>
									<div class="form-row form-row-s mt10">
										<a class="fl" href="{:U('Login/forget')}">忘记密码?</a> <a
											class="fr" href="{:U('Register/index')}"><b>立刻注册</b></a>
									</div>
								</form>
							</div>

						</div>
					</div>

				</div>
			</div>
			<div class="clr"></div>
		</div>
	</div>
	<include file="./Public/public/footer.html" />
	<script type="text/javascript">
	
	$(function(){
	    $('.leftlogin a[action=login]').on('click',leftlogin);
	    $('.leftlogin').find('input').on('keydown',function(){
	        if (event.keyCode == "13") {
	             $('.leftlogin a[action=login]').click();
	         }
	    });
	    $('.rightlogin a[action=login]').on('click',rightlogin);
	    $('.rightlogin').find('input').on('keydown',function(){
	        if (event.keyCode == "13") {
	             $('.rightlogin a[action=login]').click();
	         }
	    });
	});
	function leftlogin(){
	    $('.leftlogin').Qsubmit(null,function(msg){
	        showModal(msg);
	        $('.leftlogin').find('img[name=img]').click();
	    });
	}
	function rightlogin(){
	    $('.rightlogin').Qsubmit(null,function(msg){
	        showModal(msg);
	        $('.rightlogin').find('img[name=img]').click();
	    });
	}
	
	$("#11_timer1033").click(function(){
  		smsSend();
  	  });
	  /**
	   * 发送短信验证码
	   */
	  var smsSend=function(){
	 	 var obj=$("#11_timer1033");
	 	 var phone = $(obj.parents('form').find('[name=mobile]')[0]).val();
	 	 if(phone==null || phone.length==0) {
	 		 showModal('请输入正确格式的手机号码');
	 		 $(obj.parents('form').find('[name=mobile]')[0]).addClass("input-error");
	 		 return false;
	 	 } else if(phone.length==11) {
	 		 $(obj.parents('form').find('[name=mobile]')[0]).removeClass("input-error");
	 	 } 
	 	 var smsurl=$("#loginFormId").attr("action");
	 	 var len=smsurl.lastIndexOf("/");
	 	 smsurl=smsurl.substring(0,len);
	 	 smsurl=smsurl+"/sendLoginSms?mobile="+phone;
	 	 $.ajax({
	 		 type:'get',
	 		 url:smsurl,
	 		 success:function(data){
	 			 if(data.code=='error') {
	 				 showModal(data.info);
	 			 } else {
	 				 fun_timedown("11_timer1033",60);
	 				 showModal(data.info);
	 				 $("#11_timer1033").unbind("click");
	 			 }
	 		 }
	 	 });
	  };
	  
	  /**
	   * 倒计时
	   */
	  function fun_timedown(str,time) {
	  	$("#"+str).text(time+"秒");
	      time = time-1;
	      if(time>=0){
	          setTimeout("fun_timedown('"+str+"','"+time+"')",1000);
	      }else{
	      		$("#"+str).bind("click", function(){smsSend(str);});
	      		$("#"+str).text("发送验证码");
	      }
	  }
	</script>
</body>
</html>